package com.ryskoo.common.hclconstant;

/**
 * @author Shawn
 */
public enum WechatPayEnum {
    // 公众号支付
    MP(1, "公众号支付"),
    // 小程序支付
    MINI(2, "小程序支付"),
    // APP支付
    APP(3, "APP支付"),
    // 扫码支付
    SCAN(4, "扫码支付"),
    // H5支付
    H5(5, "H5支付"),
    // 刷卡支付
    CARD(6, "刷卡支付");

    private int value;
    private String name;

    WechatPayEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (PayStateEnum o : PayStateEnum.values()) {
            if (o.getValue() == value) {
                return o.getName();
            }
        }
        return "";
    }
}
